package com.zdx.yswl.view.listview;

import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.widget.ListView;

public class BaseListView extends ListView {

	public BaseListView(Context context) {
		super(context);
		initSubviews();
	}

	public BaseListView(Context context, AttributeSet attrs) {
		super(context, attrs);
		initSubviews();
	}

	public BaseListView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		initSubviews();
	}

	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
		super.onMeasure(widthMeasureSpec, expandSpec);
	}
	
	protected void initSubviews() {
		super.setCacheColorHint(Color.TRANSPARENT);
		super.setScrollingCacheEnabled(false);
		super.setVerticalScrollBarEnabled(true);
		// super.setScrollBarSize(1);
		// android:fadingEdge
		super.setFadingEdgeLength(0);
		// super.setFastScrollAlwaysVisible(false);
		// 去除选中时的黄色底色
		// super.setSelector(Color.TRANSPARENT);
	}

}
